#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include "priorityqueue.h"

using namespace std;

int main()
{
	system( "mode con cols=150" );


	PriorityQueue<string, int> pQueue(EHeapType::MinHeap);

	cout << "Start Insert Value From 9 to 0 to PriorityQueueMinHeap" << endl;

	for (int i = 9; i >= 0; i--)
	{
		DataBase<string, int> temp( to_string( i ), i );
		pQueue.Insert( temp );
	}

	pQueue.Print("Done Create Queue:");

	pQueue.Pop();

	pQueue.Print( "After Delete Top Priority:" );

	pQueue.Remove("4");

	pQueue.Print( "After Remove Key 4:" );

	pQueue.Pop();

	pQueue.Print( "After Delete Top Priority:" );

	pQueue.ModifyData("8",50);

	pQueue.Print( "After Adjust Key 8 Data:" );

	pQueue.Pop();

	pQueue.Print( "After Delete Top Priority:" );

	cout << "-------------------------------------------------------" << "\n\n";

	PriorityQueue<string, int> qQueue( EHeapType::MaxHeap );

	cout << "Start Insert Value From 9 to 0 to PriorityQueueMaxHeap" << endl;

	for (int i = 9; i >= 0; i--)
	{
		DataBase<string, int> temp( to_string( i ), i );
		qQueue.Insert( temp );
	}

	qQueue.Print("Done Create Queue:");

	qQueue.Pop();

	qQueue.Print( "After Delete Top Priority:" );

	qQueue.Remove("4");

	qQueue.Print( "After Remove Key 4:" );

	qQueue.Pop();

	qQueue.Print( "After Delete Top Priority:" );

	qQueue.ModifyData("2",50);

	qQueue.Print( "After Adjust Key 2 Data:" );

	qQueue.Pop();

	qQueue.Print( "After Delete Top Priority:" );

	cout << "-------------------------------------------------------" << "\n\n";

	MergeTwoPriorityQueue(pQueue,qQueue);

	pQueue.Print("After Merge QueueA and Queue B");

	pQueue.Pop();

	pQueue.Print( "After Delete Top Priority:" );

	pQueue.Pop();

	pQueue.Print( "After Delete Top Priority:" );

	cin.get();
	cin.get();

	return 0;
}